import request from '@/utils/request'
import qs from "qs"

export default {
    //查询所有
    findAll() {
        return request({
            url: '/api-sys/payConfig/payConfigs',
            method: 'get'
        })
    },
    //根据id查询
    findById(id) {
        return request({
            url: `/api-sys/payConfig/payConfig/${id}`,
            method: "get"
        })
    },
    //根据id修改
    updateById(paySet) {
        const data = qs.stringify({
            "id": paySet.id, "name": paySet.name,
            "description": paySet.description, "appId": paySet.appId,
            "appKey": paySet.appKey, "appSecret": paySet.appSecret,
            "merchantId": paySet.merchantId, "fees": paySet.fees,
            "isCashOnDelivery": paySet.isCashOnDelivery, "isPayOnline": paySet.isPayOnline,
        })
        return request({
            url: '/api-sys/payConfig/payConfig',
            method: "put",
            data
        })
    }
}